<template>
    <div style="height: 100%;">
        <div class="welcome" v-show="!portalId">
            <div>
                <img src="@/assets/img/kong.png"/>
                <div style="text-align: center;color:#d8e0fc;font-size:24px;">{{$ti18('compomentLang.rightToolBar.welcomeTo','欢迎使用')}}{{$i18(curApp.name,'应用名称')}}</div>
            </div>
        </div>
        <div v-show="portalId">
            <PortalLayoutPreview @setPortalId="setPortalId" :appId="curApp.appId" :key="portalId"></PortalLayoutPreview>
        </div>
    </div>
</template>

<script>
import useMain from "@/stores/useMain.js";
import { mapState } from 'pinia';
import PortalLayoutPreview from "@/views/modules/portal/PortalLayoutPreview/PortalLayoutPreview.vue";

export default {
    name: "PortalHome",
    computed:{
        ...mapState(useMain,['curApp']),
    },
    components:{
        PortalLayoutPreview
    },
    data() {
        return {
            portalId: "",
        }
    },
    methods:{
        setPortalId(portalId){
            this.portalId=portalId;
        }
    }
}
</script>

<style scoped>
.welcome{
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

.welcomeImg img{
    width: 150px;
}
</style>
